package com.example.pt.entity;



import jakarta.persistence.*;
import lombok.Data;

import java.time.LocalDateTime;

@Entity
@Data
@Table
public class Torrent {

    @Id
    @Column(length = 40)
    private String infoHash;

    private Long id;
    private String name;
    private String category;
    private Long uploaderId;
    private Integer downloadCount;
    private LocalDateTime uploadedAt;
    private Float cost;
    private Float discount;

    private byte[] file;
    private Integer uploadCount;
    @ManyToOne
    private User uploadedBy;


    public void setInfoHash(String infoHash) {
        this.infoHash = infoHash;
    }

    public void setUploadedBy(User uploadedBy) {
        this.uploadedBy = uploadedBy;
    }

    public String getInfoHash() {
        return infoHash;
    }

    public User getUploadedBy() {
        return uploadedBy;
    }

    // getters and setters...
    public Long getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getCategory() {
        return category;
    }

    public Long getUploaderId() {
        return uploaderId;
    }

    public Integer getDownloadCount() {
        return downloadCount;
    }

    public LocalDateTime getUploadedAt() {
        return uploadedAt;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public void setUploaderId(Long uploaderId) {
        this.uploaderId = uploaderId;
    }

    public void setDownloadCount(Integer downloadCount) {
        this.downloadCount = downloadCount;
    }

    public void setUploadedAt(LocalDateTime uploadedAt) {
        this.uploadedAt = uploadedAt;
    }

    public void setCost(Float cost) {
        this.cost = cost;
    }

    public void setDiscount(Float discount) {
        this.discount = discount;
    }

    public Float getCost() {
        return cost;
    }

    public Float getDiscount() {
        return discount;
    }

    public void setFile(byte[] file) {
        this.file = file;
    }

    public void setUploadCount(Integer uploadCount) {
        this.uploadCount = uploadCount;
    }

    public byte[] getFile() {
        return file;
    }

    public Integer getUploadCount() {
        return uploadCount;
    }
}



